Skip to content

Conversation

@hendrikmuhs
Copy link
Contributor

add zstd compression support

Copy link
Member

@narekgharibyan narekgharibyan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, just seems that the newly written files will be possible to open with new versions of keyvi only ... don't remember do we have some sort of min version requirement somewhere in code ?

@hendrikmuhs
Copy link
Contributor Author

hendrikmuhs commented Feb 18, 2025

Good point! Yes, we have versioning in keyvi files. I will make use of it. It should be possible to only bump the version if zstd is used.

Currently an old version would throw an exception the 1st time a value has to be unpacked. With versioning in place it will not be possible to open a dictionary that uses zstd in an old version.

@hendrikmuhs
Copy link
Contributor Author

hendrikmuhs commented Feb 21, 2025

added versioning, zstd now requires a recent keyvi version, trying to load a zstd dict in 0.6.3 compared to one that uses zlib compression (both dicts built using this PR):

>>> d=keyvi.dictionary.Dictionary("zstd.kv")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_core.pyx", line 316, in _core.Dictionary.__init__
  File "_core.pyx", line 291, in _core.Dictionary._init_0
ValueError: this version of keyvi file is unsupported
>>> d=keyvi.dictionary.Dictionary("zlib.kv")
>>>

@hendrikmuhs hendrikmuhs merged commit dfa4a98 into KeyviDev:master Mar 29, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants